gdkwindow: Don't add the same window to "update_windows" twice
authorMarek Kasik <mkasik@redhat.com>
Wed, 18 Dec 2013 11:23:28 +0000 (12:23 +0100)
committerMarek Kasik <mkasik@redhat.com>
Wed, 18 Dec 2013 17:15:01 +0000 (18:15 +0100)
This prevents passing of such window to another GMainLoop.

https://bugzilla.gnome.org/show_bug.cgi?id=711552

gdk/gdkwindow.c

index 424b82423d64f1619908cc05c6de2d72ae62238f..d1216b3f82fffcbee8587783744ee59bda6f88f9 100644 (file)
@@ -3227,6 +3227,15 @@ gdk_window_add_update_window (GdkWindow *window)
   GSList *prev = NULL;
   gboolean has_ancestor_in_list = FALSE;
 
+  /*  Check whether "window" is already in "update_windows" list.
+   *  It could be added during execution of gtk_widget_destroy() when
+   *  setting focus widget to NULL and redrawing old focus widget.
+   *  See bug 711552.
+   */
+  tmp = g_slist_find (update_windows, window);
+  if (tmp != NULL)
+    return;
+
   for (tmp = update_windows; tmp; tmp = tmp->next)
     {
       GdkWindow *parent = window->parent;